import { GlobalService } from "../../services/global.service";

// components/deck-card-item/deck-card-item.component.ts
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    imgUrl: {
      type: String,
      value: ''
    },
    count: {
      type: Number,
      value: 0
    },
    cardId: {
      type: Number,
      value: 0
    },
  },

  observers: {
    'imgUrl': function () {
      this.setData({ imgUrlSm: this.data.imgUrl.replace('.png', '.jpg') });
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    STATIC_ASSETS_HOST: GlobalService.FILE_HOST,
    imgUrlSm: '',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    detail: function () {
      this.triggerEvent('detail', this.data.cardId)
    },
  }
})